export const changeLabel = (newObj, oldObj) => {
  for (const k in oldObj) {
    if (oldObj[k] instanceof Array) {
      newObj[k] = []
      changeLabel(newObj[k], oldObj[k])
    } else if (oldObj[k] instanceof Object) {
      newObj[k] = {}
      changeLabel(newObj[k], oldObj[k])
    } else {
      k === 'label' ? (newObj.text = oldObj[k]) : (newObj[k] = oldObj[k])
      /* if (k === 'label') {
        newObj.text = oldObj[k]
      } else {
        newObj[k] = oldObj[k]
      } */
    }
  }
}
